<template>
    <div>
        <el-row>
            <el-button @click="goBack" icon="el-icon-arrow-left">返回</el-button>
        </el-row>
        <el-row class="content">
            <el-tabs v-model="activeName">
                <el-tab-pane label="项目信息" name="information">
                    <information v-if="activeName === 'information'"></information> 
                </el-tab-pane>
                <el-tab-pane label="立项申请" name="application">
                    <application v-if="activeName === 'application'"></application>
                </el-tab-pane>
                <el-tab-pane label="里程碑管理" name="milestone">
                    <milestone v-if="activeName === 'milestone'"></milestone>
                </el-tab-pane>
                <el-tab-pane label="评审管理" name="review">
                    <review v-if="activeName === 'review'"></review>
                </el-tab-pane>
                <el-tab-pane label="文档管理" name="document">
                    <document v-if="activeName === 'document'"></document>
                </el-tab-pane>
                <el-tab-pane label="变更管理" name="alteration">
                    <alteration v-if="activeName === 'alteration'"></alteration>
                </el-tab-pane>
                <el-tab-pane label="结项申请" name="settlement">
                    <settlement v-if="activeName === 'settlement'"></settlement>
                </el-tab-pane>
            </el-tabs>
        </el-row>
    </div>
</template>
<script>
import information from './components/information'
import application from './components/application'
import milestone from './components/milestone'
import review from './components/review'
import document from './components/document'
import alteration from './components/alteration'
import settlement from './components/settlement'
export default {
    components: {
        information,
        application,
        milestone,
        review,
        document,
        alteration,
        settlement
    },
    data() {
        return {
            activeName: 'information'
        }
    },
    methods: {
        goBack() {
            this.$router.go(-1);
        }
    },
    mounted() {
        this.activeName = this.$route.query.nextPath || 'information';
        if(this.$route.query.bizType == '1') {
            this.activeName = 'application'
        } else if(this.$route.query.bizType == '2') {
            this.activeName = 'settlement'
        }
    }
}
</script>
<style lang="less" scoped>
    .content {
        margin-top: 20px;
    }
</style>